<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/my_update/'.$cateid)?>">

	<h3>马来西亚申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  
		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />
			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td>* Jenis Permohonan<br />
              Type of Application</td>
            <td colspan="4"><input type="radio" name="application_type" value="1" <?= (@$info->application_type==1)?'checked':''?> />
              Dalam Malaysia(In Malaysia) 
               &nbsp;&nbsp; <input type="radio" name="application_type" value="2" <?= (@$info->application_type==2)?'checked':''?> />
              Seberang Laut (Oversea)</td>
        </tr>
        <tr class="even">
            <td colspan="5"><strong>A. MAKLUMAT PEMOHON(PARTICULARS OF APPLICANT)</strong></td>
        </tr>
        <tr class="odd">
            <td>1.Nama Penuh (Huruf Besar) <br />
              Full Name (Capital Letter)</td>
            <td><input type="text" name="name" value="<?= @$info->name?>" /></td>
            <td>&nbsp;</td>
            <td>2.Jantina <br />
              Gender</td>
            <td><input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />
              Lelaki / Male
                <input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />
              Perempuan / Female</td>
        </tr>
        <tr class="even">
            <td>3.Tempat/Negara lahir<br />
              Place/Country of Birth</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
            <td>&nbsp;</td>
            <td>4.Tarikh lahir<br />
              Date of Birth</td>
            <td><select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select>
              - 
			    <select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select>
			    - 
		        <select name="birth_y"><?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select>
		        <br />
		        hari(day)- bulan(month)- tahun(year)</td>
        </tr>
        <tr class="odd">
            <td>5. Warganegera<br />
              Nationality</td>
            <td><input type="text" name="nationality" value="<?= @$info->nationality?>" /></td>
			<td>&nbsp;</td>
			<td>6.Pekerjaan<br />
			  Occupation</td>
			<td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
        </tr>
        <tr class="even">
          <td>7. Alamat<br />
            Address</td>
		<td colspan="4"><input name="address" type="text" value="<?= @$info->address?>" style="width:500px" /></td>
        </tr>
        <tr class="odd">
            <td>7.a Telephone Nos.</td>
            <td colspan="4">Office: 
              <input type="text" name="office_tel" value="<?= @$info->office_tel?>" />  
              &nbsp;&nbsp;Hand Phone: 
              <input type="text" name="mobile_tel" value="<?= @$info->mobile_tel?>" /></td>
        </tr>
        <tr class="even">
            <td>8. Tarat Perkahwinari<br />
              Marital Status</td>
            <td colspan="4">
			<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?> />
              Belum Berkahwin(Single)           &nbsp; 
			  <input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?> />
              Berkahwin(Married)</td>
        </tr>
        <tr class="odd">
            <td colspan="5"><strong>B.MAKlUMAT PASPORT PERJAlANAN /DOKUMEN PERJAlANAN<br/>
P4RT1CULARS OF PASSPORT /TRAVEL DOCUMENT</strong></td>
            
        </tr>
        <tr class="even">
            <td>9.Jenis Dokumen Perjalanan<br />
              Type of Travel Document</td>
            <td><input type="text" name="travel_document_type" value="<?= @$info->travel_document_type?>" /></td>
            <td>&nbsp;</td>
            <td>10. Nombor<br />
              Number</td>
            <td><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>"/></td>
        </tr>
		        <tr class="odd">
            <td>11. Tempat / Negara DiKeluarkan<br />
              Place / Country of Issue</td>
            <td><input name="travel_document_issue_place" type="text" value="<?= @$info->travel_document_issue_place?>" /></td>
			<td>&nbsp;</td>
			<td>12. **Sah Sehingga<br />
			  Valid Until</td>
			<td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /><br />
hari(day)- bulan(month)- tahun(year)</td>
        </tr>
        <tr class="even">
            <td colspan="5"><strong>C. BUTIR-BUTIR PENGANJURDI MALAYSIA
                <br />
              NAME OF SCHOOL OR INVITING COMPANYIN MALAYSIA</strong></td>
            
        </tr>		
        <tr class="odd">
            <td>13. Name Penuh (Huruf Besar) <br />
              Full Name (Capital Letter) </td>
            <td><input name="invite_name" type="text" value="<?= @$info->invite_name?>" /></td>
			<td>&nbsp;</td>
			<td>14. No. Kad Pengenalan<br />
			  NRIC</td>
			 <td><input name="invite_id" type="text" value="<?= @$info->invite_id?>" /></td>
        </tr>
        <tr class="even">
            <td>15. No. Telefon<br />
              Telephone No.</td>
            <td><input type="text" name="invite_tel" value="<?= @$info->invite_tel?>"/></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr class="odd">
            <td>16.Alamat<br />
              Address</td>
            <td colspan="4"><input name="invite_address" type="text" value="<?= @$info->invite_address?>" style="width:500px"/> 
              <br />Negeri(State) 
              <input name="invite_state" type="text" value="<?= @$info->invite_state?>" /></td>
        </tr>
        <tr class="even">
            <td colspan="5"><strong>D. BUTIR-BUTIR PERMOHONAN<br/>
DETAIL OF APPLICATION</strong></td>
        </tr>

        <tr class="odd">
            <td>17. Tempoh Tinggal Yang Dicadangkan<br />
              Duration Of Proposed Stay</td>
            <td colspan="4">Bulan(Month) 
              <input name="stay_duration" type="text" value="<?= @$info->stay_duration?>" /></td>
        </tr>
        <tr class="even">
            <td>18. *Tujuan Perjalanan<br />
              Purpose of Journey</td>
            <td colspan="4">
			  <input type="radio" name="journey_purpose" value="1" <?= (@$info->journey_purpose==1)?'checked':''?>/>
              Bercuti(Holiday)   
              <input type="radio" name="journey_purpose" value="2" <?= (@$info->journey_purpose==2)?'checked':''?>/>
              Transit(Transit)  
              <input type="radio" name="journey_purpose" value="3" <?= (@$info->journey_purpose==3)?'checked':''?>/>
              Urusan Perniagaan(Business)   
              <input type="radio" name="journey_purpose" value="4" <?= (@$info->journey_purpose==4)?'checked':''?>/>
              Urusan Rasmi(Official Trip)<br />
              <input type="radio" name="journey_purpose" value="5" <?= (@$info->journey_purpose==5)?'checked':''?>/>
              Melawat Saudara Mara/Kawan(Visiting Friends/Relatives)   
              <input type="radio" name="journey_purpose" value="6" <?= (@$info->journey_purpose==6)?'checked':''?>/>
              Persidangan(Conference)  
              <br />
              <input type="radio" name="journey_purpose" value="7" <?= (@$info->journey_purpose==7)?'checked':''?>/>
              Bekerja(Employment)
              <input type="radio" name="journey_purpose" value="8" <?= (@$info->journey_purpose==8)?'checked':''?>/>
              Belajar(Study) 
              <br />
              <input type="radio" name="journey_purpose" value="9" <?= (@$info->journey_purpose==9)?'checked':''?>/>
              Lain-Lain (Nyatakan)/Others (Specify)
              <input name="journey_purpose_other" type="text" value="<?= @$info->journey_purpose_other?>" /></td>
        </tr>
        
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		application_type:"required",
		name:"required",
		sex:"required",
		birth_place:"required",
		nationality:"required",
		marital_status:"required",
		travel_document_type:"required",
		travel_document_num:"required",
		travel_document_valid_date:"required",
		travel_document_issue_place:"required",
		stay_duration:"required",
		journey_purpose:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#travel_document_valid_date").datepicker();
	

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>